package com.changgou.task;

import com.changgou.config.RabbitMQConfig;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @Author: HuangFu
 * @Date: 2020/2/20 16:38
 * @Description:
 */
@Component
public class OrderTask {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    /**
     * 订单自动签收
     */
    @Scheduled(cron = "0,0,0,*,*,?")
    public void autoConfirm(){
        rabbitTemplate.convertAndSend("", RabbitMQConfig.ORDER_TACK,"ORDER_TACK");
    }

}
